<template>
	<view class="mainpadding">
		<view class="flexcenter" v-if="!list.data.length">
			<view class="placeholderimage" style="margin-top: 300rpx;"></view>
		</view>
		<view class="shanbj ffffff radius mainpadding" v-for="item in list.data" :key="item.id"
			@click="tzckxq(item.id)">
			<view class="textright xiaohei strongtext">{{httpRequest.timereturn(item.createtime*1000)}}</view>
			<view class="flexbetween">
				<!-- <view class="touxiang">
					<image src="../static/logo.png" mode=""></image>
				</view> -->
				<view class="" style="">
					<view class="flexleft">
						<view class="ershiba xiaohei nofonweight margin_right2 xiankuan">{{item.title}}</view>
						<view class="weidubtn flexcenter" v-if="item.is_read==0">未读</view>
					</view>
					<view class="margin_top1 xiaohui strongtext lianghang">{{item.des}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")

	export default {
		data() {
			return {
				httpRequest,
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			init(isPage, page) { //提现记录
				let _this = this;
				let url = '/api/user/niticeindex'
				httpRequest.request(url, 'GET', {
					page: page || 1,
					limit: _this.limit
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			// 跳转查看详情
			tzckxq(id) {
				uni.navigateTo({
					url: '/pages_mine/xiaoxixq?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.weidubtn {
		width: 82rpx;
		height: 30rpx;
		line-height: 30rpx;
		background: linear-gradient(90deg, #F7913D 0%, #EC682B 100%);
		border-radius: 33rpx 33rpx 33rpx 33rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #FFFFFF;
	}

	.touxiang {
		width: 96rpx;
		height: 96rpx;
		border-radius: 50%;

		image {
			border-radius: 50%;
			width: 100%;
			height: 100%;
		}
	}

	.shanbj {
		margin-top: 30rpx;
	}

	.shanbj:first-child {
		margin-top: 0rpx;
	}
</style>